<template>
  <div id="app" style="height: 100%">
    <loading v-model="isLoading"></loading>
    <!--判断是否开始缓存-->
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
  import ViewBox from 'vux/src/components/view-box/index'
  import XHeader from 'vux/src/components/x-header/index'
  import Loading from 'vux/src/components/loading/index'
  import { mapState } from 'vuex'

  export default {
    components: {
      ViewBox,
      XHeader,
      Loading
    },
    computed: {
      ...mapState({
        isLoading: state => state.vux.isLoading
      })
    },
    data () {
      return {}
    },
    mounted () {
    }
  }
</script>

<style lang="less">
  @import '~vux/src/styles/reset.less';

  body {
    background-color: #fff;
  }

  html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  .weui-grid__icon {
    width: 50% !important;
    height: 55% !important;
    padding-top: 8%;
  }
</style>
